<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        body{
            height: 3000px;
            border:1px solid red;
            /* overflow: hidden; */
        }
        .container {
            /* height: 3000px; */
            border:1px solid red;
            margin: 200px;
            max-height: 400px;
            /* overflow: auto; */
        }

        .nav {
            background-color: pink;
            height: 100px;
            width: 100%;
            text-align: center;
            line-height: 100px;
        }

        ul {
            list-style: none;
            text-align: center;
        }

        li {
            height: 50px;
            width: 100%;
            background-color: #666;
            line-height: 50px;
        }

        .title1 {
            background-color: rgb(0, 179, 255);
            font-weight: bold;
            position: sticky;
            top: 0px;
        }
    </style>

</head>

<body>


    <div class="container">
        <div class="title">内容一</div>
        <div class="nav title1">
            <span>头部</span>
        </div>
        <div class="content">
            <ul>
                <!-- <li class="title1">内容一</li> -->
                <li>a</li>
                <li>b</li>
                <li>c</li>
            </ul>
            <ul>
                <li class="title">内容二</li>
                <li>d</li>
                <li>e</li>
                <li>f</li>
            </ul>
            <ul>
                <li class="title">内容三</li>
                <li>g</li>
                <li>h</li>
                <li>i</li>
            </ul>
            <p>11111</p>
            <p>11111</p>
            <p>11111</p>
            <p>11111</p>
            <p>11111</p>
            <p>11111</p>
            <p>11111</p>
            <p>11111</p>

            <p>11111</p>
            <p>11111</p>


            <p>11111</p>

            <p>11111</p>
            <p>11111</p>

            <p>11111</p>
            <p>11111</p>

            <p>11111</p>

            <p>11111</p>
            <p>11111</p>

            <p>11111</p>
        </div>
    </div>

</body>


</html>